FUNCTION DAC_BitsToDWord :DWORD
TITLE = 'DAC_BitsToDWord'
//
// This functionblock convert the 32 input bits to dword
//
// Versionshistory:
// 1.0 Ersterstellung E.Dittmann

VERSION : '1.0'
AUTHOR  : 'Lenze'
FAMILY  : 'DAC'
NAME : 'bitTodw'
KNOW_HOW_PROTECT

VAR_INPUT
    xBit0:                  BOOL;
    xBit1:                  BOOL;
    xBit2:                  BOOL;
    xBit3:                  BOOL;
    xBit4:                  BOOL;
    xBit5:                  BOOL;
    xBit6:                  BOOL;
    xBit7:                  BOOL; 
    xBit8:                  BOOL;    
    xBit9:                  BOOL;    
    xBit10:                 BOOL;    
    xBit11:                 BOOL;    
    xBit12:                 BOOL;    
    xBit13:                 BOOL;    
    xBit14:                 BOOL;    
    xBit15:                 BOOL;   
    xBit16:                 BOOL;
    xBit17:                 BOOL;
    xBit18:                 BOOL;
    xBit19:                 BOOL;
    xBit20:                 BOOL;
    xBit21:                 BOOL;
    xBit22:                 BOOL;
    xBit23:                 BOOL;    
    xBit24:                 BOOL;    
    xBit25:                 BOOL;    
    xBit26:                 BOOL;    
    xBit27:                 BOOL;    
    xBit28:                 BOOL;    
    xBit29:                 BOOL;    
    xBit30:                 BOOL;    
    xBit31:                 BOOL;    
END_VAR

VAR
    dwOut:                  DWORD;
    xdwOut AT dwOut:        ARRAY[0..31] OF BOOL;

END_VAR

        
BEGIN
    xdwOut[0] := xBit0;
    xdwOut[1] := xBit1;
    xdwOut[2] := xBit2;
    xdwOut[3] := xBit3;
    xdwOut[4] := xBit4;
    xdwOut[5] := xBit5;
    xdwOut[6] := xBit6;
    xdwOut[7] := xBit7;
    xdwOut[8] := xBit8;
    xdwOut[9] := xBit9;
    xdwOut[10] := xBit10;
    xdwOut[11] := xBit11;
    xdwOut[12] := xBit12;
    xdwOut[13] := xBit13;
    xdwOut[14] := xBit14;
    xdwOut[15] := xBit15;
    xdwOut[16] := xBit16;
    xdwOut[17] := xBit17;
    xdwOut[18] := xBit18;
    xdwOut[19] := xBit19;
    xdwOut[20] := xBit20;
    xdwOut[21] := xBit21;
    xdwOut[22] := xBit22;
    xdwOut[23] := xBit23;
    xdwOut[24] := xBit24;
    xdwOut[25] := xBit25;
    xdwOut[26] := xBit26;
    xdwOut[27] := xBit27;
    xdwOut[28] := xBit28;
    xdwOut[29] := xBit29;
    xdwOut[30] := xBit30;
    xdwOut[31] := xBit31;

    DAC_BitsToDWord := dwOut;
     
END_FUNCTION

